package com.zrf.base.knowledge.method.dispatch;

/**
 * @author zhouruifeng
 * Created by zhouruifeng on 2018/4/16.
 */
public class StaticDispatchTest {
    static abstract class Human{

    }

    static class Man extends Human {

    }

    static class Woman extends Human {

    }

    private static void say(Man man) {
        System.out.println("man");
    }

    private static void say(Human human) {
        System.out.println("human");
    }

    private static void say(Woman woman) {
        System.out.println("woman");
    }

    public static void main(String[] args) {
        Human man = new Man();
        Human women = new Woman();
        say(man);
        say(women);
    }
}
